//
//  MinePhotosCollectionViewCell.m
//  MJApp
//
//  Created by scjh on 15/5/13.
//  Copyright (c) 2015年 wangliang. All rights reserved.
//

#import "MinePhotosCollectionViewCell.h"

@interface MinePhotosCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *cellImageView;
@property (weak, nonatomic) IBOutlet UIButton *deleteBtn;

@end

@implementation MinePhotosCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setStatus:(BOOL)status {
    
    _status = status;
    self.deleteBtn.hidden = !status;
}

- (void)setInfoDic:(NSDictionary *)infoDic {
    
    _infoDic = infoDic;
    if ([infoDic[@"image"] isKindOfClass:[UIImage class]]) {
        self.cellImageView.image = infoDic[@"image"];
    }else {
    
        NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kUrl,infoDic[@"image"][@"image"]]];
        [self.cellImageView sd_setImageWithURL:url];
    }
    
}
- (IBAction)deleteBtn:(id)sender {
    
    if ([self.delegate respondsToSelector:@selector(homeCell:withInfo:)]) {
        
        [self.delegate homeCell:self withInfo:self.infoDic];
    }
}

@end
